#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define kMaxSize 1000
#define ErrorCode -1

typedef struct BigIntNode *BigInt;
struct BigIntNode {
    int digits[kMaxSize]; /* 各位数字从低位到高位顺次存储 */
    int length; /* 位数 */
    int sign; /* 正负 */
};

int max(int x, int y) {
    return (x > y) ? x : y;
}

BigInt ReadBigInt();
BigInt BigIntMultiply(BigInt a, BigInt b);

int main(void) {
    BigInt a, b, c;
    int i;

    a = ReadBigInt();
    b = ReadBigInt();
    c = BigIntMultiply(a, b);
    if (c->length == 0) {
        printf("0");
    }
    if (c->sign == -1) {
        printf("-");
    }
    for (i = c->length - 1; i >= 0; i--) {
        printf("%d", c->digits[i]);
    }

    return 0;
}

/* 算法2-11：大整数相乘运算  BigIntMultiply(a, b) */
BigInt BigIntMultiply(BigInt a, BigInt b) {
    BigInt c;
    int i, j, carry, temp;

    c = (BigInt)malloc(sizeof(struct BigIntNode));
    if ((a->length == 0)
    || (b->length == 0)) { /* 处理结果为0的特殊情况 */
        c->sign = 1;
        c->length = 0;
    } else { /* a和b均不为0 */
        if (a->sign == b->sign) { /* 判断结果的符号位 */
            c->sign = 1;
        } else {
            c->sign = -1;
        }
        c->length = a->length + b->length - 1; /* 确定结果的位数 */
        if (c->length > kMaxSize) {
            printf("错误：位数超限。\n");
            c->length = ErrorCode;
            return c;
        }
        for (i = 0; i < c->length; i++) { /* 初始化c */
            c->digits[i] = 0;
        }
        for (i = 0; i < a->length; i++) { /* 计算并累加结果 */
            for (j = 0; j < b->length; j++) {
                c->digits[i + j] += (a->digits[i] * b->digits[j]);
            }
        }
        carry = 0; /* 初始化进位值 */
        for (i = 0; i < c->length;
                i++) { /* 从最低位到最高位依次处理进位问题 */
            temp = c->digits[i] + carry;
            c->digits[i] = temp % 10;
            carry = temp / 10;
        }
        if (carry > 0) { /* 最高位产生进位 */
            if (c->length == kMaxSize) {
                printf("错误：位数超限。\n");
                c->length = ErrorCode;
            } else {
                c->digits[c->length] = carry;
                c->length++;
            }
        }
    }
    return c;
}
/* 算法2-11 结束 */

BigInt ReadBigInt() {
    int i, j, n;
    BigInt x;
    char s[kMaxSize + 2];

    x = (BigInt)malloc(sizeof(struct BigIntNode));
    scanf("%s", s);
    n = strlen(s);
    i = 0;
    if (s[0] == '-') {
        x->sign = -1;
        x->length = n - 1;
        i++;
    } else {
        x->sign = 1;
        x->length = n;
    }
    if (x->length > kMaxSize) {
        printf("错误：位数超限。\n");
        x->length = ErrorCode;
    } else {
        j = x->length - 1;
        while (s[i] != '\0') {
            x->digits[j] = s[i] - '0';
            i++;
            j--;
        }
        if (x->digits[x->length - 1] == 0) {
            x->length = 0; /* 0做特殊处理 */
        }
    }
    return x;
}